#ifndef HWCODEC_UTILS_H
#define HWCODEC_UTILS_H


typedef const char *        astring;


#ifndef sq
#define sq(a)       ((a)*(a))
#endif

#ifndef MIN
#define MIN(a, b)   ((a)<(b)?(a):(b))
#endif // MIN

#ifndef MAX
#define MAX(a, b)   ((a)<(b)?(b):(a))
#endif // MAX

#ifndef ABS
#define ABS(a)      (((a)>0)?(a):-(a))
#endif // ABS


#ifndef _MAX_PATH
#define _MAX_PATH 260
#endif

#define DEFAULT_DELTA_VALUE 5

typedef struct _compare_result_t
{
    int width;
    int height;
    float y_compare_rate;
    float u_compare_rate;
    float v_compare_rate;
    float total_compare_rate;
}compare_result_t;

extern compare_result_t compare_yuv420p_nv12(int width, int height, unsigned char *yuvdata, unsigned char *nv12data);


#endif  //   HWCODEC_UTILS_H
